# 基础插件类


class BasePlugin:
    """
    子类必须有显式的name，required_params属性，
    当name为None或空值时，该插件不会被加载
    """
    name = None
    required_params = []

    def validate_params(self, params):
        for param in self.required_params:
            if param not in params:
                raise ValueError(f"Missing required parameter: {param}")

    def run(self, **kwargs):
        raise NotImplementedError("Subclasses must implement run()")
